#include<stdio.h>
#include<math.h>
#include<GL/glut.h> 
#include<time.h>
#include "bodyShape.h"



void main()
{
	FILE *Bodyfile;
	int BodyfileStatus;

    Bodyfile=fopen("Body.txt","r+"); // opening the file body.txy where the spider's body parameters are saved.


	
	initBody(&arg,Bodyfile); // initializing the spider's body parameters ( the structure fields ).

	glutInitWindowPosition(20,20);	// define position of window in the screen
	glutInitWindowSize(700,700);	// define the window size
	glutInitDisplayMode(GLUT_DEPTH|GLUT_RGB); // define display mode
	
	id=glutCreateWindow("ourBody"); // creates the window and give it a name and its id
	glDepthFunc(GL_LESS);
	
	glutReshapeFunc(reshape); // calls the reshape function
	glutDisplayFunc(renderCallBack); // calls the drawing function reference
	glutKeyboardFunc(ourKBfunc); // the keyboard function for saving and quitting the application
	glutSpecialFunc(keyPress); // the special keyboard function for the spider's arms and juncturas movement
//	glutIdleFunc(idle); // the animation of the spider when the application is in an idle state
	glutMainLoop();  
}

 give it a name and its id
	glDepthFunc(GL_LESS);
	
	glutReshapeFunc(reshape); // calls the reshape function
	glutDisplayFunc(renderCallBack); // calls the drawing function reference
	glutKeyboardFunc(ourKBfunc); // the keyboard function for saving and quitting the application
	glutSpecialFunc(keyPress); // the special keyboard function for the spider's arms and junctur